/**
 * @description 公用的api功能
 * @author 印明帝
 */
const router = require('koa-router')()
const { loginCheck } = require('../../middleware/loginCheck')
const { customFormmidable } = require('../../utils/file')
const { saveFile } = require('../../control/utils')

router.prefix('/api/utils')

// 上传文件
router.post('/upload',loginCheck,async (ctx,next) => {
  
  // 获取图片数据
  ctx.body = await saveFile(ctx)
})


module.exports = router